package com.zy.cat.entity.ad;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.CatAppAdOperPrimary;

import javax.persistence.Column;
import lombok.Data;
import lombok.RequiredArgsConstructor;

/**
 * @info APP每日广告操作信息
 * @author Link
 * @date 2019-04-10 11:52
 */
@Entity
@Table(name = "zy_cat_app_ad_oper", indexes = {
		@Index(name = "ctime", columnList = "ctime"),
		@Index(name = "mtype", columnList = "mtype"),
		@Index(name = "atype", columnList = "atype"),
		@Index(name = "ltype", columnList = "ltype"),
		@Index(name = "vscode", columnList = "vscode"),
		@Index(name = "pid", columnList = "pid")
		})
@Data
@RequiredArgsConstructor
@IdClass(CatAppAdOperPrimary.class)
public class CatAppAdOper {
	
	@Id
	@Column(columnDefinition = "VARCHAR(10) NOT NULL COMMENT '时间[APP每日广告操作信息]'")
	private String ctime;
	
	@Id
	@Column(columnDefinition = "INT(1) NOT NULL COMMENT '广告类型（0.广告位、1.翻倍广告）'")
	private int atype;
	
	@Id
	@Column(columnDefinition = "INT(1) DEFAULT'-1'  COMMENT '设备类型：(-1.全部、0.安卓、1.IOS)'")
    private int mtype;
	
	@Id
	@Column(columnDefinition = "INT(1) DEFAULT'0'  COMMENT '广告来源平台：(0.穿山甲平台、1.腾讯)'")
    private int ltype;
	
	@Id
	@Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '用户ID'")
	private String pid="";
	
	@Id
	@Column(columnDefinition = "VARCHAR(20) DEFAULT'-'  COMMENT 'APP版本号'")
	private String vscode;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT'0' COMMENT '展示量'")
	private long ashow;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT'0' COMMENT '点击量'")
	private long click;
	
	public CatAppAdOper(String pid) {
		super();
		this.pid = pid;
	}

	public CatAppAdOper(String ctime, int atype, int mtype, String pid, long show, long click,int ltype,String vscode) {
		super();
		this.ctime = ctime;
		this.atype = atype;
		this.mtype = mtype;
		this.pid = pid;
		this.ashow = show;
		this.click = click;
		this.ltype=ltype;
		this.vscode=vscode;
	}

	public CatAppAdOper(String ctime, int atype, int mtype, String pid, long ashow, long click,String vscode) {
		super();
		this.ctime = ctime;
		this.atype = atype;
		this.mtype = mtype;
		this.pid = pid;
		this.ashow = ashow;
		this.click = click;
		this.vscode=vscode;
	}
}
